<template>
  <section class="payBox">
    <section class="imgBox">
      <img :src="qrImg"/>
    </section>
    <section class="btnBox">
      <el-button
          class="btn btn-default"
          type="button"
          ecols-button
          @click="backGame()">
        返回游戏
      </el-button>
      <el-button
          class="btn btn-primary"
          type="button"
          ecols-button
          @click="paySuccess()">
        支付完成
      </el-button>
    </section>
  </section>
</template>

<script>
import {BRNative} from "../../utils/brNative";

export default {

  data() {
    return {
      qrImgN: '',
      qrImg: '',
      successUrlN: '',
      successUrl: '',

    }
  },
  created() {
    this.getLoad();
  },
  methods: {
    //初始化加载
    getLoad() {
      let paramsData = this.$route.query;
      this.qrImgN = paramsData['qr'];
      this.successUrlN = paramsData['back'];
      this.qrImg = decodeURIComponent(this.qrImgN);
      this.successUrl = decodeURIComponent(this.successUrlN);
    },

    //跳转完成页面
    paySuccess() {
      window.location.href = this.successUrl;
    },
    //返回游戏
    backGame() {
      BRNative.gamePayFinish("no", 2);
    }
  }
};
</script>

<style lang='less'>
@import "../../assets/css/gamePay/smPay.less";
</style>
